package com.ruoyi.web.config;

import com.ruoyi.web.schedule.task.CheckProgrammeTaskHandle;
import com.sdstc.modules.service.OrgDetailYearService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class JobTaskConfig implements InitializingBean, DisposableBean {

    private static JobTaskConfig jobTaskConfig = null;
    public static JobTaskConfig getAdminConfig() {
        return jobTaskConfig;
    }


    // ---------------------- XxlJobScheduler ----------------------

    private JobTaskConfig xxlJobScheduler;

    @Override
    public void afterPropertiesSet() throws Exception {
        jobTaskConfig = this;

        CheckProgrammeTaskHandle.getInstance().start();
    }

    @Override
    public void destroy() throws Exception {
        jobTaskConfig.destroy();
    }



    @Autowired
    private OrgDetailYearService orgDetailYearService;

    public OrgDetailYearService getOrgDetailYearService() {
        return orgDetailYearService;
    }




}
